home *** CD-ROM | disk | FTP | other *** search
/ LSD Docs / LSD Docs.iso / FILEZ / lsd08.dms / lsd08.adf / 71 / 71
Text File  |  1990-02-22  |  34KB  |  732 lines

  1.                         POWERPACKER PROFESSIONAL
  2.  
  3. Typed in by ???. Edited by PARASITE.
  4.  
  5.  
  6. AN INTRODUCTION
  7. PowerPacker is a userfriendly command and data cruncher, this means a menu
  8. driven utility that can crunch almost any file on your disks.  It can be
  9. started from the CLI or the WorkBench, just type it's name in the CLI window
  10. or doubleclick it's icon.  PowerPacker will detach itself from the CLI so you
  11. can close the CLI window.  When you use it for the first time it's best to
  12. maintain a certain order in your actions (as we will see in chapter 6 of this
  13. document):
  14.  
  15.   (a) Check the packer options at the beginning of a session (Prefs menu)
  16.   (b) Load the file from disk (Project menu)
  17.   (c) Wait for the file to (de)crunch.
  18.   (d) Save the file back to disk (Project menu)
  19.  
  20.      Apart from crunching, you can also recrunch files that were crunched by
  21.      most other crunchers.
  22.      The HunkLab enables you to e.g. force code or data in chip ram.
  23.      The script allows you to e.g. crunch a dozen of files overnight.
  24.  
  25.      Before I demonstrate how to use PowerPacker, let's look at the file
  26.      requester and an overview of the menus and capabilities.
  27.  
  28. THE FILE REQUESTER
  29.     Whenever you are required to enter a filename, PowerPacker sets up a file
  30. requester.  This requester lists all the files (and their length) of a
  31. selected directory.  You don't have to wait for the directory scan to end, you
  32. can select a file or directory the moment you see it, or you can enter it in
  33. the appropriate string gadget.  If you press <SHIFT-ENTER> in a string gadget
  34. you will activate the other string gadget (file or directory).  To get a list
  35. of all devices connected to your Amiga as well as all the assigns made press
  36. the right mouse button.
  37.     If you wait for the directory scan to end and quit the file requester, the
  38. next time you use it all the files will still be there, so you don't have to
  39. wait for the directory to be read again.  This feature has one disadvantage :
  40. if files are changed or added to the selected directory they won't be shown in
  41. the list, or they will be shown with the wrong filelength, the next time the
  42. requester appears.  Therefore, if you think anything has been changed to the
  43. selected directory, use the 'GET DIR' gadget to re-read the directory.  (E.g.
  44. when you save a crunched file on top of the old one, the old file length will
  45. be shown in the requester.)
  46.      Use the 'Hide/Show .info' gadget to hide or show .info files (workbench
  47. icons).  The 'ALL' and 'CLR' gadget are used to select all files or to clear
  48. the selection of all files, note that these gadgets are not always available.
  49. When the ALL and CLR gadgets are available you can also extend-select
  50. filenames, just press the <SHIFT>-key when selecting files.  The entries are
  51. always sorted and files and directories are seperated.  The requester also
  52. contains an invisible dragbar so you can drag it to another screen position to
  53. see what is underneath.
  54.  
  55. THE BASIC MENUS
  56.  
  57. PROJECT
  58.     The project menu contains the file manipulation options.  Most of them
  59. speak for themselves:
  60.  
  61.   Load      ->  Load a file from disk and start the (de)crunching.
  62.                 Files crunched with other (supported) crunchers will be
  63.                 recognized and decrunched.
  64.   Save      ->  Save the (de)crunched or processed file in memory to disk.
  65.   Delete    ->  Delete a file from disk.
  66.   Read      ->  Read an ASCII (text) file using PPMore.
  67.   WorkBench ->  Open or close WorkBench if possible. (Adds 42K !)
  68.   Sleep     ->  Put PowerPacker to sleep on the WorkBench Screen, this
  69.                 frees 40-50K.
  70.                 WARNING: All buffers will be deallocated, so you are advised
  71.                          to save things first.
  72.   About...  ->  Show general information.
  73.   Quit      ->  Quit the program.
  74.  
  75. NOTE: - To read a file PPMore is used. The first time you use 'Read' PPMore
  76.         will probably not be found and PowerPacker will ask you where it is.
  77.         Just use the file requester and select PPMore, save the preferences if
  78.         you want PowerPacker to remember this the next time you run it.
  79.  
  80. PREFS
  81.      The prefs menu contains all the (de)cruncher settings.  You can select
  82. to (de)crunch command files or data files.  If you want the crunched version
  83. of your file to be executable, select 'Command file'.  Now PowerPacker knows
  84. it has to add a decrunch header.  If the file you want to crunch only contains
  85. data (e.g. source codes of your programs), select the 'Data file' option.
  86. This can be handy if you're going to use the PowerPacker CLI commands.  I'll
  87. discuss these commands in chapter 7 of this document.
  88.  
  89. NOTE: - PowerPacker will automatically decrunch a previously crunched
  90.         file.  You don't have to select crunch or decrunch mode anymore as
  91.         in PowerPacker 2.0a.
  92.  
  93.      The 'Decrunch Color' submenu contains the following options :
  94.  
  95.   Color 0   ->  The background color will change while decrunching
  96.   Color 1   ->  The text color changes
  97.   Pointer   ->  Only the mousepointer's color changes
  98.   Scroll    ->  Weird effect (just try it out !)
  99.   None      ->  If your eyes are wearing out.
  100.  
  101.      These options indicate what color will flash when a file is decrunched.
  102. You can change this option before saving a crunched file, so you can save a
  103. version of your crunched program that flashes in color 1, and one that
  104. flashes in the mouse pointer.  The default value is 'Pointer'.
  105.  
  106.      In the efficiency submenu you will find the following possibilities :
  107.  
  108.   Fast      ->  Use for small files, or for quick crunch.
  109.   Mediocre  ->  Better but slower.
  110.   Good      ->  Default, gains 40-50% in most cases.
  111.   Very Good ->  A few percent better than good.
  112.   Best      ->  Gives best results (not always !)
  113.  
  114. NOTE: - 'Best' isn't always the best.  Small files crunch best with
  115.         'Very Good' or even 'Good'.
  116.  
  117.      The 'Speedup Buffer' controls the size of the memory buffer used to
  118. speed up crunching.  You have three choices:
  119.  
  120.   Small     ->  This takes from 2K to 32K  (about 8 times faster than 2.3b)
  121.   Medium    ->  This takes from 4K to 64K  (about 12 times faster)
  122.   Large     ->  This takes around 200K !!  (about 40-50 times faster !)
  123.  
  124. NOTE: - If you have a 512K Amiga you probably can't use the large speedup
  125.         buffer.
  126.  
  127.      The remaining preference switches:
  128.  
  129.   Data Suffix  -> Attach '.pp' suffix to data files after crunching or remove
  130.                   '.pp' after decrunching.  It is advised that you leave this
  131.                   switch on so you can easily spot crunched data files.
  132.   BCPL Header  -> Select this if you want the special decrunch header for BCPL
  133.                   programs (soon to be a thing of the past :-). The Workbench
  134.                   c: directory contains such programs.
  135.   Auto HunkLab -> File is put through hunklab before crunching when you select
  136.                   'Load', this way you can always automatically remove symbol
  137.                   and debug hunks (see further).
  138.   Auto Recrunch-> If the file is crunched with an alien cruncher it is not
  139.                   only decrunched, but it is also recrunched.
  140.   Encrypt File -> See section 1.3.3 of this manual.
  141.   Color Crunch -> Flash the selected decrunch color when crunching, giving
  142.                   you an idea what the decrunching will look like (provided
  143.                   that you don't change any options just before saving to
  144.                   disk).
  145.   LED Crunch   -> Your power-LED flashes while crunching, just like the
  146.                   screencolors. Now, you can even turn off your monitor and
  147.                   still see when the cruncher has finished.
  148.   Paging       -> Pause and wait for mouse button when supervisor window
  149.                   fills up.
  150.   Overwrite    -> Don't prompt if it's ok to overwrite a file when saving.
  151.   Verify sleep -> When this switch is on you will be prompted if you are sure
  152.                   you want PowerPacker to go to sleep.
  153.   Sound Alarm  -> When this is on PowerPacker beeps when done with crunching.
  154.  
  155.      Use 'Save Preferences' to save the preferences to your boot disk.  The
  156. preferences will be saved in the file 's:PowerPacker.prefs', this file will
  157. be 86 bytes long.  When PowerPacker 3.0a is first started it will attempt to
  158. load this file and adjust the preferences.
  159.  
  160. NOTE: - While crunching, you can press both mousebuttons at the same time to
  161.         abort.  Keep them pressed down long enough !
  162.  
  163. CRYPT
  164.      When the 'Encrypt File' switch is on PowerPacker will not only crunch
  165. files, it will also encrypt them so nobody else but you can decrunch them.
  166. Just before crunching a file PowerPacker will ask you for a password.  You
  167. will be presented with a string gadget with a special feature, it won't show
  168. you what you are typing !  After entering your password you will be asked to
  169. enter it again, this is done to verify that you haven't made a typing error
  170. (watch out you don't make the same error twice :-).
  171.      You can also use the 'Last' gadget to re-enter your last password again,
  172. or the 'Abort' gadget to abort the encryption and just crunch the file.
  173.      When you try to load a crunched encrypted file PowerPacker will once
  174. again prompt you for your password.  If you enter the correct one the file
  175. will be decrypted and decrunched.  If you don't know the password, bad luck,
  176. THERE IS *NO* WAY YOU CAN DECRUNCH THIS FILE !!
  177.      From version 3.0a onwards PowerPacker also encrypts executables. When
  178. you run an encrypted executable you will be prompted for the password. A
  179. small window will open and you have 3 chances to type your password followed
  180. by <ENTER>.  There is no possibility to correct typing mistakes, this would
  181. just have made the decrunch header too long (currently 792 bytes).
  182.  
  183. NOTE: - Encryption can currently not be used in a script.
  184.       - Your password can be up to 16 characters long, any character is
  185.         accepted, lowercase and uppercase are DIFFERENT !!!!
  186.       - Take care when using the 'Last' gadget, be sure to remember what your
  187.         last password was.
  188.       - Don't forget your password !!  It is *IMPOSSIBLE* to decrypt a file
  189.         without the password !!!!!
  190.  
  191. RECRUNCH
  192.  
  193. HOW ?
  194.      This menu is provided for the people who were using another cruncher or
  195. an older version of PowerPacker.  Just select 'Recrunch File' or 'Recrunch
  196. Always' and load the file.  PowerPacker will start the correct decrunch
  197. algorithm.  If you selected 'Recrunch' PowerPacker will start to crunch the
  198. decrunched file.  If you select 'Recrunch Always' PowerPacker will always
  199. recrunch, even if the file was crunched with this version of PowerPacker.
  200. Useful for recrunching files using a higher efficiency (e.g. recrunch a 'Fast'
  201. crunched file with 'Best').
  202.      If you select 'Load' and PowerPacker recognizes an alien crunched file
  203. it will decrunch it for you, if you have switched 'Auto Recrunch' on the
  204. decrunched file will be recrunched with PowerPacker. The 'Load' menu option
  205. actually replaces the 'Recrunch File' menu option, but the latter one was
  206. left in for old times sake :-)
  207.      Use the 'Change Color' item to change the decrunch color in an already
  208. crunched file to the current decrunch color.  Please note that the file will
  209. be changed on disk, nothing will be loaded into memory.
  210.      Crunchers currently supported are:  'ANC Cruncher', 'TNM Cruncher 1.1',
  211. 'Relokit 1.0', 'HQC Cruncher 2.0', 'MasterCruncher 3.0', 'DragPack 1.0b',
  212. 'TurboSqueeze 5.1', 'Titan Cruncher 1.1', 'Imploder 1.0' and older
  213. PowerPacker files.  If you'd like to see other crunchers supported, send me
  214. the cruncher and some programs crunched with it.  If it is possible to
  215. develop a decrunch algorithm I will include it in the next version of
  216. PowerPacker.
  217.  
  218. NOTE: - 'Decrunch Only' is not 100% guaranteed for 'Relokit 1.0' files,
  219.         'Recrunch' however is 100% ok ! (It's a strange world ! :-)
  220.       - Several people sent me 'dirty' crunchers, these are crunchers that
  221.         use absolute addresses (an absolute TABOO !!!).  It is impossible
  222.         to develop a decrunch algorithm for these. (In fact, nothing should
  223.         have been crunched with these crunchers in the first place !)
  224.  
  225. THE HUNKLAB
  226.  
  227. PREFERENCES
  228.      This menu is not really part of the PowerPacker crunch/decrunch routines
  229. but it wasn't worth writing a separate program for and a HunkLab is after all
  230. a very interesting utility.  You can e.g. use it to remove symbol and debug
  231. hunks from files that wouldn't crunch otherwise.
  232.  
  233.      You can force a program's code, data or BSS (uninitialised data) into
  234. chip ram or you can remove symbol tables and debug information just by
  235. toggling the marker on/off.
  236.  
  237. PROCESS FILE
  238.      'Process file' reads the file from disk and changes it according to your
  239. preferences.  To save the processed file, use 'Save' from the Project menu.
  240.      'Process & Crunch' will process the file and crunch the file afterwards
  241. (if possible).  To save use 'Save' in the Project menu.
  242.  
  243. NOTE: - Debug and symbol hunks are only used in debuggers, so you can safely
  244.         remove them from a program. (Unless you want to debug the program.)
  245.  
  246. THE SCRIPT MENU
  247.      The script is something that will save you a lot of time, it allows you
  248. to record a number of different commands to be executed after each other.  It
  249. is ideal for crunching a lot of files in one go.  It also offers you the
  250. possibility to delete the source files after crunching, so you can easily
  251. crunch a directory full of data files and delete the source files after the
  252. crunched files with .pp suffix are saved. Menu options are:
  253.  
  254.      'Clear Script' and 'List Script':
  255.           will do just that.
  256.      'Set # commands':
  257.           select to be prompted a new maximum number of commands to be
  258.           recorded. (Default is 80)
  259.      'Script Log File':
  260.           is used to specify a file to redirect output to.  If you cancel
  261.           the requester no log file is used.
  262.      'Destination Dir':
  263.           is used to specify the directory to save to.  It is ghosted in
  264.           normal use.
  265.      'Start Recording':
  266.           is used to start the recording of the script. If the script was
  267.           empty you will be asked for the destination directory.
  268.               After selecting the destination you can start entering the
  269.           script commands.  Everything that is ghosted is not available as a
  270.           command.  Just enter everything as if you were actually using
  271.           PowerPacker, with one big difference: you can select more than one
  272.           file at a time. Just press the <SHIFT> key to extend-select other
  273.           files. When you then press OK all these files will be entered in
  274.           the script.  You can also use the ALL and CLR gadgets as described
  275.           in the file requester section.
  276.           NOTE: - You can still change the source and destination dir while
  277.                   recording.
  278.           Every command you enter will be displayed in the supervisor window.
  279.      'Stop Recording':
  280.           is used to exit the recording mode.
  281.      'Delete Last':
  282.           will delete the last command after a confirmation.
  283.      'Delete Command':
  284.           to delete a specific command, you will be prompted for the command
  285.           number.
  286.      'Insert Command':
  287.           to insert a new command after another command. You will be asked
  288.           after which command you want to insert something. Enter the command
  289.           number.
  290.  
  291.      'Skip Crunched':
  292.           when you enter this command in the script PowerPacker will skip
  293.           crunched files rather than decrunch them. Select again to turn off.
  294.      'Delete Source':
  295.           this command tells PowerPacker to delete the source file after it
  296.           has crunched (and saved) it to the destination. Select again to
  297.           turn off.
  298.      'Delete Quick':
  299.           the same as the previous command but now the source is deleted
  300.           BEFORE the crunched file is saved. (useful for when source and
  301.           destination are on the same disk and the disk is very full)
  302.           Select again to turn off.
  303.  
  304.      'Execute Script':
  305.           will start the playback of the script commands.  If you press the
  306.           menu button a requester will appear to ask you if you want to abort
  307.           the script execution.  After executing the script a request to
  308.           clear the script will appear.
  309.  
  310. NOTE: - The screen turns grey to indicate a script is executing.
  311.       - While executing a script, PowerPacker will always act destructive !
  312.         Files will allways be overwritten and deleted, no confirmations !!!
  313.       - After the script has executed you will be presented with the script
  314.         statistics.  This way you can see what the overall gain was.
  315.  
  316. THE SUPERVISOR WINDOW
  317.      This window displays all kind of useful information like the file
  318. status, crunch messages, and error messages.  You can follow all steps, from
  319. the original file that is loaded into memory, to the final crunched version
  320. on disk.  When an executable file is loaded, its hunk information is
  321. displayed.  This information is rather technical, but it can be useful for
  322. programmers.  If you're not interested, just ignore it.
  323.  
  324. A SAMPLE SESSION
  325.      Now that I have explained PowerPacker's capabilities, it's time for
  326. a little demonstation.  Let's say we want to crunch the 'CLI' command in the
  327. System directory on your Workbench 1.2 disk.
  328.  
  329.      Select 'Pointer' in the Prefs/Decrunch Color menu (When I wrote this
  330. text, it was very late and I couldn't stand the other decrunch colors
  331. anymore !)
  332.  
  333.      Set 'Prefs' to 'Command file'.  Now select 'Load' in the Project menu
  334. (the file requester will appear), insert your WorkBench 1.2 disk and choose
  335. the 'CLI' command in the system directory.  Now you'll see a lot of hunk
  336. (or junk ?? :-) information about the CLI command:
  337.  
  338.      Scanning file 'df0:System/CLI'...
  339.      Loading command file...
  340.      Hunk_header (0x03F3)
  341.         9 hunks (0 to 8).
  342.      Hunk  0 : Hunk_code (0x03E9)     (524 bytes)
  343.                Hunk_reloc32 (0x03EC) 
  344.      Hunk  1 : Hunk_data (0x03EA)     (428 bytes, 0 BSS)
  345.      Hunk  2 : Hunk_code (0x03E9)     (472 bytes)
  346.                Hunk_reloc32 (0x03EC) 
  347.      Hunk  3 : Hunk_data (0x03EA)     (52 bytes, 0 BSS)
  348.      Hunk  4 : Hunk_code (0x03E9)     (16 bytes)
  349.      Hunk  5 : Hunk_code (0x03E9)     (0 bytes)
  350.      Hunk  6 : Hunk_code (0x03E9)     (196 bytes)
  351.                Hunk_reloc32 (0x03EC) 
  352.      Hunk  7 : Hunk_code (0x03E9)     (68 bytes)
  353.                Hunk_reloc32 (0x03EC) 
  354.      Hunk  8 : Hunk_data (0x03EA)     (0 bytes, 0 BSS)
  355.      Crunching command file...
  356.      Press left and right button to abort.
  357.      Crunching, please wait.
  358.                                                                              
  359.      The cruncher displays the percentage of the file already crunched and
  360. the gain so far. After some time your screen will look like this:
  361.  
  362.      100% crunched.
  363.      Done.
  364.      Original length : 2356 bytes.
  365.      Crunched length : 1204 (1804) bytes.
  366.      Gained 49% (1152 bytes) !
  367.                                                                              
  368.      The only thing you have to do now is save this back to disk as an
  369. executable file.  Now enjoy the crunched CLI command.
  370.  
  371. POWERPACKER 3.0A & THE CLI
  372.      For your convenience, I have also written two CLI commands, one to
  373. crunch and one to decrunch data files.
  374.      These CLI commands use the magnificent ARP library !!  This means they
  375. are very powerful : wildcards are fully supported, options can be entered in
  376. any order, directories will be created when needed, etc...  Make sure the
  377. arp.library is in your LIBS:  directory when you run these commands.
  378.      A usage line is given by typing 'Crunch' or 'Decrunch' without
  379. arguments.  You'll get something like this:
  380.  
  381.  
  382. 1> Crunch
  383. POWER-PACKER 3.0a Data Cruncher.
  384.   Written by Nico François (PowerPeak)
  385. Usage : Crunch <source> [<destination>] [EFFICIENCY 1-5] [COLOR 0-4] [CRYPT]
  386.                                     [NOSUFFIX] [NOLED] [NOPER] [SLOW] [FAST]
  387. With:
  388.  EFFICIENCY: 1 = Fast, 2 = Mediocre, 3 = Good (def), 4 = Very Good, 5 = Best
  389.  COLOR     : 0/1 = Color 0/1, 2 = Pointer (def), 3 = Scroll, 4 = None
  390.  CRYPT     : Encrypt file.
  391.  NOSUFFIX  : No '.pp' suffix.
  392.  NOLED     : No flashing led.
  393.  NOPER     : No percentage.
  394.  FAST      : Fast crunch.
  395.  SLOW      : Slower crunch.
  396. Hit ^C to abort, ^E or ^F to abort crunching only.
  397.  
  398. 1> Decrunch
  399. POWER-PACKER 3.0a Data Decruncher.
  400.   Written by Nico François (PowerPeak)
  401. Usage : Decrunch <source> <destination> [COLOR 0-4] [OPT B|F] [SKIP] [QUIET]
  402. With:
  403.    COLOR: 0/1 = Color 0/1, 2 = Pointer (def), 3 = Scroll, 4 = None
  404.    SKIP : Skip uncrunched files.
  405.    QUIET: Be quiet.
  406. If <destination> is '*' or is omited, files will be typed to Output().
  407. Options effective when typing:
  408.    OPT B: print a banner before and
  409.    OPT F: print a formfeed after each file.
  410. Hit ^C to abort, ^E or ^F to abort typing only.
  411.  
  412. 1>
  413.  
  414.  
  415.      These commands are useful to be included in your startup-sequence or to
  416. read crunched text files quickly.
  417.  
  418.   Some examples:
  419.  
  420.      Crunch df0:source/*.c TO ram:source COL 4 NOLED
  421.  
  422.      This will result in a crunching of every C program in the df0:source
  423. directory.  If the ram:source directory exists the files will be saved there,
  424. if it doesn't it will be created if there is more than one C program in
  425. df0:source.  The '.pp' suffix will be attached to the filenames.  The led
  426. will not flicker, no crunch color is used.
  427.  
  428.      Decrunch >PRT: QUIET dh0:progs/*.asm.pp OPT BF COL 3
  429.  
  430.      Every crunched assembly program will be decrunched and printed, before
  431. each file a banner will be printed, each file will start on a new page.  If
  432. the file is encrypted you will be prompted for a password.  It is very
  433. important that you use the QUIET option here, if you don't the copyright and
  434. information lines will also be printed.  The mouse pointer will flash while
  435. decrunching.
  436.  
  437. NOTE: - These commands only (de)crunch DATA files !!!!  (So to (de)crunch
  438.         executable files, you'll still have to use PowerPacker).
  439.       - The Crunch command defaults to using the large crunch buffer, you can
  440.         use the medium buffer by selecting FAST and the small buffer by
  441.         selecting SLOW.
  442.  
  443. POWERPACKER 3.0A & OTHER PROGRAMS
  444.  
  445. INTRODUCTION
  446.      This one is for the programmers among you !
  447.      With this version the decrunch source is included.  I decided to do this
  448. so other programs could load data files crunched with PowerPacker.  As an
  449. example I could refer to one of my other utilities : PPMore, this is a text
  450. viewing utility (like more, hence the name) that can also display ASCII files
  451. crunched with PowerPacker.
  452.      Source is presented as a support function 'PP_LoadData', this function
  453. will load a data file and will decrunch it if necessary.  When the file isn't
  454. crunched it'll just be loaded.  Encrypted files are also supported.
  455.      The source should compile under both Aztec C and Lattice C.  As provided
  456. the source will compile under Lattice C 5.04 (makefile included), it should be
  457. no problem to get it to compile under Aztec C.  You can use this code for
  458. non-commercial purposes as long as you leave my copyright notice intact.
  459.  
  460. THE FUNCTION
  461.   error = PP_LoadData (file, color, typeofmem, buffptr, lengthptr, password);
  462.  
  463.   with:
  464.      char *file;         filename of file to be loaded
  465.      UBYTE color;        decrunch color (see ppdata.h)
  466.      ULONG typeofmem;    type of memory to be allocated
  467.      UBYTE **buffptr;    address of buffer pointer variable
  468.      ULONG *lengthptr;   address of length variable
  469.      char *password;     pointer to password string or NULL
  470.  
  471.   NOTE:
  472.      - error and color codes are defined in 'ppdata.h'.
  473.      - memory must be freed by caller after usage : FreeMem (buff, length);
  474.  
  475.      You have the following decrunch colors available:
  476.  
  477.           DECR_COL0      Decrunch in color 0
  478.           DECR_COL1         ''    '' color 1
  479.           DECR_POINTER      ''    '' the mouse pointer
  480.           DECR_SCROLL       ''    '' the scroll register
  481.           DECR_NONE      No decrunch color is used
  482.  
  483.      The following errors can occure:
  484.  
  485.           PP_LOADOK      No error, file loaded succesfully.
  486.           PP_LOCKERR     Couldn't lock file, file probably doesn't exist.
  487.           PP_OPENERR     Couldn't open file.
  488.           PP_READERR     Read error.
  489.           PP_NOMEMORY    No memory to allocate buffer for data file.
  490.           PP_CRYPTED     File is crypted and no password was provided.
  491.           PP_PASSERR     File is crypted and wrong password provided.
  492.  
  493. LOADING ENCRYPTED FILES
  494.      To load encrypted files a password has to be provided to the function.
  495. First of all try to load the file with a NULL pointer for 'password', when
  496. you get the PP_CRYPTED error you know that the file is encrypted.  Then
  497. prompt the user for a password and call the function again with the same
  498. parameters, but now 'password' points to the password string.  If PP_LoadData
  499. returns PP_LOADOK the file was decrypted, if it returns PP_PASSERR the
  500. password was incorrect.  If it returns anything else some sort of error
  501. occured (see 'ppdata.h' for the error codes).
  502.  
  503. COMPILING AND LINKING
  504.      Use the makefile if you have Lattice C 5.04.  If you use Aztec C you must
  505. compile 'ppdata.c' and assemble 'ppasm.asm', this should be no problem.  Once
  506. compiled you will have two objecy files:  'ppdata.o' and 'ppasm.o'.  Link with
  507. both these files if you use the 'PP_LoadData' fuction.
  508.  
  509. AN EXAMPLE
  510.      This small (incomplete) program shows you how to use the support
  511. function in your programs.
  512.  
  513. test.c
  514.  
  515. #include <exec/types.h>
  516. ...
  517.  
  518. #include "ppdata.h"
  519.  
  520. UBYTE *buffer = NULL;
  521. ULONG bufferlength;
  522. UBYTE password[17];
  523.  
  524. main()
  525. {
  526.      int error;
  527.  
  528.      error = PP_LoadData ("df0:doc/Packer.doc.pp", DECR_POINTER, MEMF_PUBLIC,
  529.           &buffer, &bufferlength, NULL);     /* Don't forget the '&' !!!!! */
  530.      if (error != PP_LOADOK) switch (error) {
  531.           case PP_LOCKERR:
  532.                puts ("file not found !!!");
  533.                FreeStuffAndExit();
  534.           case PP_LOADERR:
  535.                puts ("loading error !!!");
  536.                FreeStuffAndExit();
  537.           case PP_NOMEMORY:
  538.                puts ("out of memory !!!");
  539.                FreeStuffAndExit();
  540.           ...
  541.           case PP_CRYPTED:
  542.                /* prompt the user for a password (max 16 chars) */
  543.                ...
  544.                error = PP_LoadData ("df0:docs/Packer.doc.pp", DECR_POINTER,
  545.                     MEMF_PUBLIC, &buffer, &bufferlength, password);
  546.                if (error == PP_PASSERR) {
  547.                     puts ("incorrect password !!!");
  548.                     FreeStuffAndExit();
  549.                     }
  550.                else if (error != PP_LOADOK) {
  551.                     puts ("correct password, but couldn't load !!!");
  552.                     FreeStuffAndExit();
  553.                     }
  554.                break;
  555.           }
  556.      /* now do something with the data file loaded at addr 'buffer' and with
  557.         length 'bufferlength' */
  558.      ...
  559.      /* DO NOT FORGET TO FREE THE MEMORY !! */
  560.      FreeMem (buffer, bufferlength);
  561.      buffer = NULL;
  562. }
  563.  
  564. FreeStuffAndExit()
  565. {
  566.      /* free all your resources */
  567.      ...
  568.      exit (0);
  569. }
  570.  
  571.  
  572. PROGRAM HISTORY:
  573.  
  574.  
  575. VERSION 1.0a
  576.  
  577.      First release.
  578.  
  579. _________________________________________________________________________
  580.  
  581. VERSION 1.1a
  582.  
  583.      Fixed bugs.
  584.      Improved crunch algorithm by about 5%.
  585.      'Delete' and 'Multitask' added.
  586.      Better menu structure.
  587.      Improved the file requester.
  588.      Written CLI commands.
  589. _________________________________________________________________________
  590.  
  591. VERSION 2.0a
  592.  
  593.      Fixed some more bugs.
  594.      Added buffer and automatic device-list to the file requester.
  595.      Added 'LED Crunch', useful for turning the monitor off while crunching,
  596.      and 'Paging'.
  597.      New header, bug fixed. (1.1 didn't free mem when started from WorkBench)
  598.      Added the hunklab.
  599.      Improved CLI commands.
  600. _________________________________________________________________________
  601.  
  602. VERSION 2.1a
  603.  
  604.      Fixed last bug in header (2.0 crashed when you were out of memory, oops)
  605.      Added script feature, now possible to crunch files overnight.
  606.      Improved requesters.
  607.      Automatic crunch/decrunch.
  608.      Improved menu structure considerably.
  609.      Intelligent recrunch implemented.
  610.      Automatic crunch/decrunch.
  611.      Added 'Color Crunch' option.
  612.      New efficiency 'Best' added.
  613. _________________________________________________________________________
  614.  
  615. VERSION 2.1b
  616.  
  617.      Bug fixed in script abort.
  618.      Added ability to open a log file during script execution.
  619.      Now possible to recrunch PowerPacker files with a higher efficiency.
  620.      Recrunch detects unsupported crunchers a lot faster.
  621.      PowerPacker now automatically opens a PAL/NTSC screen.
  622. _________________________________________________________________________
  623.  
  624. VERSION 2.2a
  625.  
  626.      All known bugs (or better, undocumented features) fixed.
  627.      'Sleep' mode implemented, useful for multitasking freaks.
  628.      While crunching the gain percentage so far is displayed.
  629.      Recrunch now supports 'HQC Cruncher 2.0', 'MasterCruncher 3.0'
  630.        and 'Dragpack 1.0'.
  631.      New graphics in title.
  632. _________________________________________________________________________
  633.  
  634. VERSION 2.3a
  635.  
  636.      PowerPacker detaches itself from the CLI, so the CLI window can be
  637.        closed or used for other things.
  638.      CLI commands are greatly enhanced, they now use ARP.
  639.      New switch : 'Overwrite' to surpress 'OK to overwrite ?' request.
  640.      File requester now able to sort files, 'Sort files' switch.
  641.      By popular demand: encryption of data files is now possible using the
  642.        new 'Encrypt Data' switch. Encryption should be IMPOSSIBLE to crack !!
  643.      Also by popular demand: Now possible to save preferences to boot disk.
  644.      More memory efficient decrunch and recrunch of PowerPacker files.
  645.      Decrunch source included, so other programs could be written that
  646.        would load data files crunched with PowerPacker.
  647.      'Data Suffix' switch to improve adding/removing of '.pp' suffix.
  648.      Decrunch color default 'Pointer'.
  649.      Improved scanning of files when loading or recrunching.
  650.      Fixed small bug (version 2.2a lost 256 bytes every time it was run).
  651.      More info in about window.
  652. _________________________________________________________________________
  653.  
  654. VERSION 2.3b
  655.  
  656.      Added 'Change Color' in 'Recrunch' menu to change the decrunch color
  657.        of an already crunched file.
  658.      PowerPacker now starts up a process with priority -1.  It now no longer
  659.        slows down the rest of the system (e.g. a CLI) when crunching.
  660.      New 'Verify sleep' switch to toggle the requester that verifies the
  661.        sleep function on/off.
  662.      Now possible to skip files already crunched with PowerPacker in script.
  663.      Bug fixed in 'Recrunch', ANC files were no longer recognized. Oops :-)
  664. _________________________________________________________________________
  665.  
  666. VERSION 3.0a
  667.  
  668.      FIRST COMMERCIAL VERSION, *MAJOR* UPDATE !!
  669.  
  670.      FAST !!!!  40-50 times faster crunching than previous versions !!!
  671.        Three different speeds selectable. Multitask switch removed, no longer
  672.        needed.
  673.      Full overlay support !!! (crunches e.g. DPaint III)
  674.      Decrunching 20% faster.
  675.      Crunches up to 5% (yippee :-)
  676.      Recrunch now supports 'TurboSqueeze', 'Titanics' and 'Imploder'.
  677.      Decrunch header more memory efficient, you can now also decrunch and
  678.        run programs larger than 250K on a 512K machine.
  679.      Script much more powerful:
  680.        - Insert #, Delete #.
  681.        - New commands : Skip crunched files.
  682.                         Delete source files (safe or quick).
  683.        - Maximum number of script commands user-definable.
  684.      Automatic hunklab and automatic recrunch switches.
  685.      Recrunches data files.
  686.      Encrypted executables !!!!!  Protect your programs as well as data !
  687.      File requester much improved:
  688.        - user-friendlier sorting, no more file-chasing !
  689.        - files / directories seperated.
  690.        - show/hide .info files
  691.        - extended selection possible (including ALL and CLEAR gadgets, for
  692.          use in script)
  693.        - drag-bar, position is remembered for the next time you use it.
  694.        - shows all devices attached as well as all assigns made
  695.        - 7 entries on screen at once (previously 6)
  696.        - supports SHIFT-ENTER "standard" to jump from file to dir gadget
  697.      Switch for BCPL programs added (WorkBench 1.3 c: directory)
  698.      Position of the small sleep-window is remembered, so the window will
  699.        open where you last left it.
  700.      Read (crunched) text files from within PowerPacker. (using PPMore)
  701.      Sound alarm.
  702.      Extended menu selecting now supported.
  703.      Script prints statistics after execution.
  704.      Before saving, length of crunched file is compared to original length.
  705.      Abort now only works when PowerPacker screen is active, no more problems
  706.        when multitasking.
  707.      CLI commands improved:
  708.        - are reentrant, can be made resident and run from several CLI's at
  709.          once.
  710.        - also 40-50 times faster
  711.        - shorter code
  712.        - 'Crunch NOSUFFIX' bug fixed, used to delete original file if source
  713.          and destination where the same and crunching was aborted.
  714.  
  715.  
  716. PowerPacker 3.0a written by Nico François (Yes, Nico is my first name :-)
  717. Special thanks go to - Luc Pauwels for the icons and writing the 2.0a manual,
  718.                      - Jorrit Tyberghein and Ives Aerts for the extensive
  719.                        debugging.
  720.                      - Christian Morant for the late night 'turbo' hack :-)
  721.                      - Kenny for his invaluable suggestions
  722.                      - a very special thank you to all the people who
  723.                        supported the shareware versions of PowerPacker.
  724.  
  725. End.
  726.